package com.itfreer.gather.setting;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.itfreer.gather.R;
import com.itfreer.security.SecurityService;
import com.itfreer.ui.activity.BaseActivity;
import com.itfreer.ui.base.TextView;

/**
 * 密码修改
 */
public class PasswordActivity extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.setting_password_activity);

        // 返回
        TextView me =(TextView)findViewById(R.id.setting_password_back);
        me.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                finish();
            }
        });

        final EditText opText =(EditText)findViewById(R.id.setting_password_op);
        final EditText npText =(EditText)findViewById(R.id.setting_password_np);
        final EditText rnpText =(EditText)findViewById(R.id.setting_password_rnp);

        Button okButton =(Button)findViewById(R.id.setting_password_ok);
        okButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                SecurityService.instance.setPassword(opText.getText().toString(), npText.getText().toString(),
                        rnpText.getText().toString(), PasswordActivity.this);
            }
        });
    }
}
